//
//  ViewController.m
//  ChainedSDKDemo
//
//  Created by sny on 2018/5/18.
//  Copyright © 2018年 HuangYangYang. All rights reserved.
//

#import "ViewController.h"
#import <MKUIChained/MKUIChained.h>
#import "Focus.h"
#import "User.h"

@interface ViewController ()

@property (strong , nonatomic) NSArray *imageArray;

@end

@implementation ViewController

- (NSArray *)imageArray {
    if (!_imageArray) {
        _imageArray = @[@"ico_guide1", @"ico_guide2", @"ico_guide3",@"ico_guide4"];
    }
    return _imageArray;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //1.Focus类的生成方式
//    Focus *focus = [Focus ]
    
    Focus *focus = (Focus *)[Focus new].initParamsWithArray(@[[NSNumber numberWithInt:1],@"haha"]);
    
    NSLog(@"focus : %d %@",focus.type,focus.imageUrl);
    
    // UIButton的使用 分段式写法
    
    //1.设置按钮的背景颜色 弧度 外围线条的颜色
    
    UIButton *button = (UIButton *)[UIButton new].chainedblackGroundColor([UIColor blueColor]);
    button.chainedLayerBorder([UIColor yellowColor],15.f);
    
    button.chainedLayerCircular(15,YES);
    
    //2.设置按钮的显示的文字 字体大小 字体的颜色
    button.titleParams(@"按钮",14.f,[UIColor orangeColor]);
    
    //3.设置按钮的点击后和点击前的图片
    button.selectImageParams([UIImage imageNamed:@""],[UIImage imageNamed:@""]);
    
    //UIButton的使用 链式的写法
    UIButton *chainedButton = (UIButton *)[UIButton new].chainedblackGroundColor([UIColor blueColor])
                                                        .chainedLayerBorder([UIColor yellowColor],15.f)
                                                        .chainedLayerCircular(15,YES);
    
    chainedButton.titleParams(@"按钮",14.f,[UIColor orangeColor]).selectImageParams([UIImage imageNamed:@""],[UIImage imageNamed:@""]);
    
    
    //UIScrollView 段落式写法
    
    //1.设置滚动图的背景颜色
    UIScrollView *scrollView = (UIScrollView *)[UIScrollView new].chainedblackGroundColor([UIColor blueColor]);
    //2.设置是否显示水平和垂直方向的滚动条
    scrollView.chainedScrollIndicator(NO,NO);
    //3.设置是否滚动和翻页
    scrollView.chainedScrollEnabled(YES,YES);
    //4.设置scrollView的delegate
    scrollView.chainedScrollDelegate(self);
    
    //UIScrollView 链式写法
    
    //1.设置背景颜色
     UIScrollView *chainedScrollView = (UIScrollView *)[UIScrollView new].chainedblackGroundColor([UIColor blueColor]);
    
    chainedScrollView.chainedScrollIndicator(NO,NO).chainedScrollEnabled(YES,YES).chainedScrollDelegate(self);
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
